import Engines from '@/utils/engine.js'
const engine = new Engines()

const api = {
  login: '/adminApi/userManagement/doLogin',
  userinfo: '/adminApi/userManagement/getUserInfo',
  loginOut: '/adminApi/userManagement/quit',
  sendSms: '/user/send_sms',
  newLogin: '/user/do_login',
  getUser2: '/user/get',
  userOut: '/user/do_out',
  authInfo: '/user/auth_info',
  upRole: '/user/refresh_role',
  opuserList: '/user/opuser_list',
  getCanbindNum: '/user/canbind_num',
  getBindReady: '/user/bind_ready',
  BindOpeate: '/user/bind',
  BindRemove: '/user/bind_remove',
  getUserList: '/user/company_user_list',
  delUser: '/user/del_company_user',
}

export default api
// new 删除后台用户接口
export function delUser(param) {
  return engine._request2({
    url: api.delUser,
    method: 'POST',
    param: param
  })
}
// new 获取后台用户列表接口
export function getUserList(param) {
  return engine._request2({
    url: api.getUserList,
    method: 'POST',
    param: param
  })
}
// new 解除绑定运营人员接口
export function BindRemove(param) {
  return engine._request2({
    url: api.BindRemove,
    method: 'POST',
    param: param
  })
}
// new 绑定运营人员接口
export function BindOpeate(param) {
  return engine._request2({
    url: api.BindOpeate,
    method: 'POST',
    param: param
  })
}
// new 获取绑定运营人员的所需要的信息接口
export function getBindReady(param) {
  return engine._request2({
    url: api.getBindReady,
    method: 'POST',
    param: param
  })
}
// new 获取剩余可绑定运营人员数量接口
export function getCanbindNum(param) {
  return engine._request2({
    url: api.getCanbindNum,
    method: 'POST',
    param: param
  })
}
// new 获取运营人员列表接口
export function opuserList(param) {
  return engine._request2({
    url: api.opuserList,
    method: 'POST',
    param: param
  })
}
// new 获取验证码
export function sendSms(param) {
  return engine._request2({
    url: api.sendSms,
    method: 'POST',
    param: param
  })
}
// new 登录
export function newLogin(param) {
  return engine._request2({
    url: api.newLogin,
    method: 'POST',
    param: param
  })
}
// new 获取用户信息
export function getUser2(param) {
  return engine._request2({
    url: api.getUser2,
    method: 'POST',
    param: param
  })
}
// new 退出登录
export function userOut(param) {
  return engine._request2({
    url: api.userOut,
    method: 'POST',
    param: param
  })
}
// new 获取用户认证信息
export function authInfo(param) {
  return engine._request2({
    url: api.authInfo,
    method: 'POST',
    param: param
  })
}
// new 跟新角色
export function upRole(param) {
  console.log(param)
  return engine._request2({
    url: api.upRole,
    method: 'POST',
    param: param
  })
}


export function doLogin(param) {
  return engine._request({
    url: api.login,
    method: 'POST',
    param: param
  })
}


export function getUserInfo(param) {
  return engine._request({
    url: api.userinfo,
    method: 'POST',
    param: param
  })
}

export function loginOut(param) {
  return engine._request({
    url: api.loginOut,
    method: 'POST',
    param: param
  })
}


